home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / gofer221.zip / MINPREL < prev    next >
Text File  |  1991-11-20  |  2KB  |  58 lines

  1. --         __________   __________   __________   __________   ________
  2. --        /  _______/  /  ____   /  /  _______/  /  _______/  /  ____  \
  3. --       /  / _____   /  /   /  /  /  /______   /  /______   /  /___/  /
  4. --      /  / /_   /  /  /   /  /  /  _______/  /  _______/  /  __   __/
  5. --     /  /___/  /  /  /___/  /  /  /         /  /______   /  /  \  \ 
  6. --    /_________/  /_________/  /__/         /_________/  /__/    \__\
  7. --
  8. --    Functional programming environment, Version 2.21
  9. --    Copyright Mark P Jones 1991.
  10. --
  11. --    Minimal Gofer prelude for experimentation with different approaches
  12. --    to standard operations.
  13. --
  14. --    Any Gofer prelude file should typically include at least the following
  15. --    definitions:
  16.  
  17. infixr 5 :
  18. infixr 3 &&
  19. infixr 2 ||
  20.  
  21. (&&), (||)     :: Bool -> Bool -> Bool
  22. False && _      = False     -- (&&) and (||) names predefined in Gofer
  23. True  && x      = x
  24. False || x      = x
  25. True  || _      = True
  26.  
  27. flip           :: (a -> b -> c) -> b -> a -> c
  28. flip  f x y     =  f y x
  29.  
  30. error          :: String -> a
  31. error s | False = error s
  32.  
  33. -- I/O functions and definitions:
  34. -- This is the minimum required for bootstrapping and execution of
  35. -- interactive programs.
  36.  
  37. data Request  =  -- file system requests:
  38.                 ReadFile      String         
  39.               | WriteFile     String String
  40.               | AppendFile    String String
  41.                  -- channel system requests:
  42.               | ReadChan      String 
  43.               | AppendChan    String String
  44.                  -- environment requests:
  45.               | Echo          Bool
  46.  
  47. data Response = Success
  48.               | Str String 
  49.               | Failure IOError
  50.  
  51. data IOError  = WriteError   String
  52.               | ReadError    String
  53.               | SearchError  String
  54.               | FormatError  String
  55.               | OtherError   String
  56.  
  57. type Dialogue = [Response] -> [Request]
  58.